<?php

namespace App\Models;

class Configs extends Base
{
    protected $table = 'configs';

    public $timestamps = false;

    protected $fillable = [
        'id','name','setting'
    ];

    protected $casts = ['setting' => 'array'];

    /**
     * 根据标识获取配置
     * @param $name 标识
     * @return mixed
     */
    protected function getConfig($name){
        $config = $this->where('name',$name)->first()->toArray();
        return $config['setting'];
    }

}
